<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ include file="/commons/pages/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div class="subtitle">
  <h3>编辑信息</h3>
</div>
<s:form action="BaseBuildingInfo!save.action" method="post" name="form" enctype="multipart/form-data">
  <s:token />
  <input type="hidden" name="model.id" value="<s:property value='model.id'/>"/>
  <input type="hidden" name="model.unit_num" value="<s:property value='model.unit_num'/>"/>
  
  <table width="100%" border="0" cellpadding="5" cellspacing="1" class="tbl_list">
    <tr>
      <th width="20%" align="right"><font color="red">*</font>楼栋名称：</th>
      <td width="80%"><input name="model.b_name" type="text" class="webinput" size="25" dataType="Require" msg="请填写" value="<s:property value='model.b_name'/>"/></td>
    </tr>
     <tr>
      <th width="20%" align="right"><font color="red">*</font>楼栋编号：</th>
      <td width="80%"><input name="model.build_no" type="text" class="webinput" size="25" dataType="Require" msg="请填写" value="<s:property value='model.build_no'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>所属项目：</th>
      <td width="80%">
   	  <select id="sel_proj" name="model.proj_id" dataType="Require" msg="请填写选择" onchange="initShareList(this.value,'sel_area')"></select>
      </td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>所属分摊区域：</th>
      <td width="80%">
   	  <select id="sel_area" name="model.area_id" dataType="Require" msg="请填写选择"></select>
      </td>
    </tr>
     <tr>
      <th width="20%" align="right">楼栋附件：</th>
      <td width="80%">
      <c:if test="${not empty accessary}">
	    	<a href="${ctx}/${accessary.url }" target="_blank">${accessary.ac_sname }</a><br/>
	  </c:if>
      <input name="accList" type="file" class="webinput" size="25"/></td>
    </tr>
    <tr>
      <th width="20%" align="right"></th>
      <td width="80%">
      	<select id="selSink" onchange="setDefaultSinkValue(this.value)">
      		<option value="">请选择</option>
      		<s:iterator value="standSinkList" var="cur">
      			<option value="<s:property value="#cur.ID"/>"><s:property value="#cur.SINK_NAME"/></option>
      		</s:iterator>
      	</select>
   	  </td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器类型：</th>
      <td width="80%"><input id="m_sink_name" name="model.sink_name" type="text" class="webinput" size="25" dataType="Require" msg="请用填写" value="<s:property value='model.sink_name'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器品牌：</th>
      <td width="80%"><input id="m_sink_brand" name="model.sink_brand" type="text" class="webinput" size="25" dataType="Require" msg="请用填写" value="<s:property value='model.sink_brand'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器高：</th>
      <td width="80%"><input id="m_sink_height" name="model.sink_height" type="text" class="webinput" size="25" dataType="Ftdfnum" msg="请用数字正确填写" value="<s:property value='model.sink_height'/>"/>mm</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器宽：</th>
      <td width="80%"><input id="m_sink_width" name="model.sink_width" type="text" class="webinput" size="25" dataType="Ftdfnum" msg="请用数字正确填写" value="<s:property value='model.sink_width'/>"/>mm</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器长：</th>
      <td width="80%"><input id="m_sink_length" name="model.sink_length" type="text" class="webinput" size="25" dataType="Ftdfnum" msg="请用数字正确填写" value="<s:property value='model.sink_length'/>"/>mm</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器中心距：</th>
      <td width="80%"><input id="m_sink_cen_dis" name="model.sink_cen_dis" type="text" class="webinput" size="25" dataType="Ftdfnum" msg="请用数字正确填写" value="<s:property value='model.sink_cen_dis'/>"/>mm</td>
    </tr>
    <tr>
      <th width="20%" align="right"><font color="red">*</font>默认散热器每片计算功率：</th>
      <td width="80%"><input id="m_cal_power" name="model.cal_power" type="text" class="webinput" size="25" dataType="Ftdfnum" msg="请用数字正确填写" value="<s:property value='model.cal_power'/>"/>W</td>
    </tr>
    <tr>
      <th width="20%" align="right">计划散热器总数：</th>
      <td width="80%"><input name="model.sink_number" type="text" class="webinput" size="25" dataType="Integer" require="false" msg="请用数字正确填写" value="<s:property value='model.sink_number'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right">计划集中器总数：</th>
      <td width="80%"><input name="model.jzq_number" type="text" class="webinput" size="25" dataType="Integer" require="false" msg="请用数字正确填写" value="<s:property value='model.jzq_number'/>"/></td>
    </tr>
    <tr>
      <th width="20%" align="right">备注：</th>
      <td width="80%"><textarea id="textarea" name="model.demo" cols="60" rows="8"><s:property value='model.demo'/></textarea></td>
    </tr>
    <tr>
      <th>&nbsp;</th>
      <td><input type="submit" class="websub" value="提 交" />
        <input type="button" class="websub" onclick="history.back();" value="返 回" /></td>
    </tr>
  </table>
</s:form>
<script src='/dwr/interface/BaseDataService.js'></script>
<script src='/dwr/engine.js'></script>
<script src='/dwr/util.js'></script>
<script src='/commons/scripts/validator.js'></script> 
<script type="text/javascript">
$j(document).ready(function(){
	initProjAreaBuildingRoom('sel_proj','<s:property value='model.proj_id'/>','sel_area','<s:property value='model.area_id'/>');
	form.onsubmit = function () {
		return Validator.Validate(this, 3);
	}
});

function setDefaultSinkValue(sinkId){
	if(!sinkId){
		DWRUtil.setValue("m_sink_name","");  
		DWRUtil.setValue("m_sink_brand","");  
		DWRUtil.setValue("m_sink_height","");  
		DWRUtil.setValue("m_sink_width","");  
		DWRUtil.setValue("m_sink_length","");  
		DWRUtil.setValue("m_sink_cen_dis","");  
		DWRUtil.setValue("m_cal_power",""); 
	}else{
		BaseDataService.selectStandardValue(sinkId,function(BaseData){
			DWRUtil.setValue("m_sink_name",BaseData.sink_name);  
			DWRUtil.setValue("m_sink_brand",BaseData.sink_brand);  
			DWRUtil.setValue("m_sink_height",BaseData.sink_height);  
			DWRUtil.setValue("m_sink_width",BaseData.sink_width);  
			DWRUtil.setValue("m_sink_length",BaseData.sink_length);  
			DWRUtil.setValue("m_sink_cen_dis",BaseData.sink_cen_dis);  
			DWRUtil.setValue("m_cal_power",BaseData.cal_power);  
		});
	}
}
</script>
</body>
</html>
